package com.controller;

import com.pojo.Vehicle;
import com.service.VehicleService;
import com.vo.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/Vehicle")
public class VehicleController {
    @Resource
    private VehicleService vehicleService;
    @ResponseBody
    @RequestMapping("/selectVehicleService")
    public Result selectVehicleByOwnerId(Integer ownerid){

        List<Vehicle> vehicles = vehicleService.selectVehicleByOwnerId(ownerid);
        System.out.println(vehicles);
        return Result.success(vehicles);
    }
}
